import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-04-06
 * Time: 11:53
 */
public class test0 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){
            int n = sc.nextInt();
            int sum =0 ;
            while (n>0){
                if(n%2==1){
                    sum++;
                }
                n/=2;
            }
            System.out.println(sum);
        }
    }
}
